home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11884 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: tank.news.pipex.net!pipex!iol!usenet
  2. From: David Byrden <goyra@iol.ie>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: pointer questions
  5. Date: 16 Mar 1996 21:34:46 GMT
  6. Organization: Ireland On-Line
  7. Message-ID: <4ifc5m$m8o@nuacht.iol.ie>
  8. References: <4ifajv$4n7s@uvaix3e1.comp.UVic.CA>
  9. NNTP-Posting-Host: dialup-184.dublin.iol.ie
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22KIT (Windows; I; 16bit)
  14.  
  15. you@somehost.somedomain (Colin Gesy) wrote:
  16.  
  17. >Could someone tell me if there is a difference
  18. >between the declaration "int *thing_ptr" and 
  19. >"int* thing_ptr" ?
  20. >Also, what is the difference between "int& data"
  21. >and "int &data" ?
  22.  
  23.     No differences.
  24.  
  25.  
  26. >What does the following statement do/mean? :
  27. >
  28. >     ((searchItem&) *this)._refCount++;   //searchItem is the class name
  29.  
  30.     This code comes from a member function of some object, whose address 
  31. is "this". Dereferring "this" gives you the object itself. The object is 
  32. being cast to the class searchItem, probably because it is a base class of 
  33. searchItem. If so, the programmer should be using dynamic_cast<>. Finally, 
  34. a member variable in the searchItem is incremented.
  35.  
  36.                                      David
  37.  
  38.  
  39.